package com.example.javachatroomextend.service;

import com.example.javachatroomextend.mapper.MessageMapper;
import com.example.javachatroomextend.model.Message;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MessageService {
    @Autowired
    private MessageMapper messageMapper;

    public List<Message> getMessageBySessionId(Integer sessionId) {
        return messageMapper.getMessageBySessionId(sessionId);
    }

    public Integer addMessage(Integer sessionId,Integer fromId,String content) {
        return messageMapper.addMessage(sessionId,fromId,content);
    }
}
